//
//  LTLfaXian.m
//  WeiBo
//
//  Created by Apple_Lzzy46 on 16/9/12.
//  Copyright © 2016年 LTL. All rights reserved.
//

#import "LTLfaXian.h"

@interface LTLfaXian ()

@property (nonatomic , weak )UITextField *txet;

@end

@implementation LTLfaXian

- (void)viewDidLoad {
    [super viewDidLoad];
    
    //设置按钮
    [self setNnavigationItem];
    if (self.langView == NULL) {
        
        UITextField * txet = [[UITextField alloc]initWithFrame:CGRectMake(0, 0, 450, 35)];
        //    UITextField * txet = [[UITextField alloc]init];
        
        txet.background = [UIImage imageNamed:@"common_button_white_disable"];
        
        txet.placeholder = @"请输入搜索关键字";
        
        self.navigationItem.titleView = txet;
        
        _txet = txet;
        
        UIImageView *imager = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"tabbar_discover"]];
        
        txet.leftView = imager;
        txet.leftViewMode = UITextFieldViewModeAlways;
    }
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
//滑动,关闭键盘
-(void)scrollViewDidScroll:(UIScrollView *)scrollView
{

    [_txet becomeFirstResponder];
}
#pragma mark - Table view data source

/**
 *  组数
 */
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    //#warning Incomplete implementation, return the number of sections
    return 1;
}
/**
 *  行数
 */
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    //#warning Incomplete implementation, return the number of rows
    return 12;
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    /**
     *  重用标识符
     */
    static NSString *ID = @"faXian";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    //判断cell是否为空
    if (!cell) {
        cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:ID];
    }
    cell.backgroundColor = [UIColor clearColor];
    cell.textLabel.text = [NSString stringWithFormat:@"第%@行",@(indexPath.row)];
    ///设置点击不变色
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    return cell;
}

//设置按钮
-(void)setNnavigationItem
{
    if (self.langView == nil) {
        /**
         修改返回按钮
         */
        UIBarButtonItem *back = [[UIBarButtonItem alloc]init];
        back.title = @"返回";
//        self.navigationItem.backBarButtonItem = back;
//        // 右按钮
//        self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithImage:[UIImage imageNamed:@"navigationbar_friendsearch"] landscapeImagePhone:[UIImage imageNamed:@"navigationbar_friendsearch_highlighted"] style:UIBarButtonItemStyleDone target:self action:nil];
//        //左按钮
//        self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithImage:[UIImage imageNamed:@"navigationbar_pop"] landscapeImagePhone:[UIImage imageNamed:@"navigationbar_pop_highlighted"] style:UIBarButtonItemStyleDone target:self action:nil];
    }
    [self.langView langTiter:@"登录后，最新、最热微博尽在掌握，不再会与实事潮流擦肩而过" imager:@"visitordiscover_image_message"];
}


/*
// Override to support conditional editing of the table view.
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
    // Return NO if you do not want the specified item to be editable.
    return YES;
}
*/

/*
// Override to support editing the table view.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
    if (editingStyle == UITableViewCellEditingStyleDelete) {
        // Delete the row from the data source
        [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
    } else if (editingStyle == UITableViewCellEditingStyleInsert) {
        // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
    }   
}
*/

/*
// Override to support rearranging the table view.
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath {
}
*/

/*
// Override to support conditional rearranging of the table view.
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {
    // Return NO if you do not want the item to be re-orderable.
    return YES;
}
*/

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
